package fristphase.day9_05.ooday08;

public class MultiTypeDemo {
    public static void main(String[] args) {
        Aoo o = new Boo();
        Boo o1 = (Boo) o;//将o强转为Boo类型
        Inter o2 = (Inter) o;//将o强转为Inter类型
//        Coo o3 = (Coo) o;
        if(o instanceof Coo){
            Coo o4 = (Coo) o;
        }else {
            System.out.println("o不是Coo类型");
        }
        if(o instanceof Inter){
            System.out.println("强转成功");
        }
    }
}
interface Inter{

}
class Aoo{
    int b = 67;
    void name(){

    }
}
class Boo extends Aoo implements Inter{
    int a = 14;
    void address(){

    }
}
class Coo extends Aoo{

}
